package main

import (
	"fmt"
	"pkg.deepin.io/lib/mime"
)

func main() {
	tmp := "text/plain"
	deskId, err := mime.GetDefaultApp(tmp, false)
	if err != nil {
		fmt.Printf("Get '%s' default app failed: %v\n", tmp, err)
		return
	}
	fmt.Printf("'%s' default app: %v\n", tmp, deskId)

	fmt.Printf("'%s' app list: %v\n", tmp, mime.GetAppList(tmp))

	fmt.Printf("Set '%s' to gvim failed: %v\n", tmp, mime.SetDefaultApp(tmp, "gvim.desktop"))
}
